package com.design.model.composite;

import javax.swing.*;

/**
 * @program: study
 * @className: Test
 * @description: TODO
 * @author: kukuxiahuni
 * @create: 2019-07-03 11:46
 * @version: v1.0
 **/
public class Test {

    public static void main(String[] args) {
        Composite composite = new Composite("root");
        composite.add(new Leaf("leaf a"));
        composite.add(new Leaf("leaf b"));

        Composite comp = new Composite("X");
        comp.add(new Leaf("leaf xa"));
        comp.add(new Leaf("leaf xb"));

        composite.add(comp);

        composite.display(1);
    }
}
